<!DOCTYPE html>
<html>
	<head>
		<include file="Public/head" />
		<link rel="stylesheet" href="__PUBLIC__/Manage/css/table.css">
		<title>用户列表</title>
		<style>
			.redText{
				color: red;font-size: 20px;
			}
		</style>
	</head>
	<body>
		<div class="nestable">
			<div class="console-title console-title-border drds-detail-title clearfix">
				<h5>用户列表</h5>
			</div>
			<form method="get" id="seachForm" action="{:U('User/wallet')}">
				 
				<div class="public-selectArea">
					<div class="clearfix">
						<div class="wp_box col-xs-6">
							<dl>
								<dt>用户名：</dt>
								<dd>
									<input type="text" name="s-username" value="{$Think.get.s-username}">
								</dd>
							</dl>
						</div>
						 
					</div>
					<div class="btnArea">
						<a href='javascript:$("#seachForm").submit();' class="btn btn-sereachBg">
							<i class="glyphicon glyphicon-search public-ico"></i>
							<span class="public-label">查询</span>
						</a>
					</div>
				</div>
			</form>
			<div class="scroll-bar-table">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>ID</th>
							<th>用户名</th>
							<th>姓名</th>
							<th>支付类型</th>
							<th>金额</th>
							<th>状态</th>
							<th>提交时间</th>
							 
							 
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
<php>$status=array('<font color="red">待确认</font>','已确认','<font color="#FA02D7">已拒绝</font>');</php>
<volist name="list" id="vo">
						<tr id="list-{$vo.id}">
							<td align="center">{$vo.id}</td>
							<td>{$vo.telnum}</td>
							<td>{$vo.name}</td>
							<td>提现</td>
							<td><span style="color: red;">{$vo.money}</span> 元</td>
							<td class="td-status">
								{$status[$vo['status']]}
							</td>
							<td>{$vo.add_time|date="Y-m-d h:i:s",###}</td>
							 
							 
							<td class="text-left">
							<if condition="$vo['status'] eq 0">
								<a href="javascript:changestatus('{$vo.id}',1,'1','{$vo.money}','{$vo.uid}');">待确认</a>|
								<a href="javascript:changestatus('{$vo.id}',2,'2','{$vo.money}','{$vo.uid}');">拒绝</a>|
								 </if>
								<a href="javascript:delWallet('{$vo.id}','{$vo.telnum}');">删除</a>
							</td>
						</tr>
</volist>
					</tbody>
				</table>
			</div>
			<div class="table-pagin-container">
				<div class="pull-right page-box">
					{$page}
				</div>
			</div>
		</div>
	</body>
	<script>
	function changestatus(id,bz,st,money,uid){
			var bzt ='';
			if(bz == 1){
				bzt ='取现';
			}else if(bz == 2){
				bzt ='拒绝';
			}
			layer.confirm(
				'￥'+money+bzt+'记录操作后不可改变,请确认？',
				{
					btn: ['确认'+bzt,'取消'],
					skin: 'layui-layer-molv'
				},function(){
					 $.post(
						"{:U('User/resetWStatus')}",
						{
							id:id,
							st:st,
							uid:uid
						},
						function(data){
							if(data.status!=1){
								layer.msg(data.info);
							}else{								
								layer.msg(bzt+"确认成功");
								setTimeout(function(){
									location.reload();
								},1000);
							}
						}
					);
				}
			);		
	
	};
    
		 
		//调整额度
		function resetQuota(id,name){
			layer.prompt(
				{
					title: '输入用户  ['+name+'] 的新额度',
					formType: 0
				},
				function(quota,index){
					cvphp.post(
						"{:U('User/resetQuota')}",
						{
							id:id,
							quota:quota
						},
						function(data){
							if(data.status!=1){
								layer.msg(data.info);
							}else{
								layer.close(index);
								layer.msg("用户资料已保存");
								setTimeout(function(){location.reload();},1000);
							}
						}
					);
				}
			);
		}
		//修改账户手机号
		function resetTel(id,name){
			layer.prompt(
				{
					title: '输入用户  ['+name+'] 的新手机号',
					formType: 0
				},
				function(tel,index){
					cvphp.post(
						"{:U('User/resetTel')}",
						{
							id:id,
							tel:tel
						},
						function(data){
							if(data.status!=1){
								layer.msg(data.info);
							}else{
								layer.close(index);
								layer.msg("用户资料已保存");
								setTimeout(function(){location.reload();},1000);
							}
						}
					);
				}
			);
		}
		//修改账户银行卡号
		function resetBank(id,name){
			layer.prompt(
				{
					title: '输入用户新银行卡号',
					formType: 0
				},
				function(bank,index){
					cvphp.post(
						"{:U('User/resetBank')}",
						{
							id:id,
							bank:bank
						},
						function(data){
							if(data.status!=1){
								layer.msg(data.info);
							}else{
								layer.close(index);
								layer.msg("用户资料已保存");
								setTimeout(function(){location.reload();},1000);
							}
						}
					);
				}
			);
		}		
		//重置密码方法
		function resetPass(id,name){
			layer.confirm(
				'确认要重置用户[ '+name+' ]登录密码吗？',
				{
					btn: ['确认','取消']
				},function(){
					cvphp.post(
						"{:U('User/resetPass')}",
						{
							id:id
						},
						function(data){
							if(data.status!=1){
								layer.msg(data.info);
							}else{
								layer.alert("用户 ["+name+"] 密码已修改为  ["+data.info+"]");
							}
						}
					);
				}
			);
		}
		//删除会员方法
		function delWallet(id,name){
			layer.confirm(
				'用户[ '+name+' ]删除提现记录',
				{
					btn: ['确认删除','取消']
				},function(){
					cvphp.post(
						"{:U('User/delWallet')}",
						{
							id:id
						},
						function(data){
							if(data.status!=1){
								layer.msg(data.info);
							}else{
								$("#list-"+id).remove();
								layer.msg("操作成功");
							}
						}
					);
				}
			);
		}
	</script>
</html>